{:W('Template/top')}
<div class="wrapper clearfix content" style="position: relative;border: 1px solid #ddd">
    {:W('Template/left')}
    <div class="rightbox pull-right">
        <div class="ur-here">您当前的位置：<a href=''>订单管理</a>&gt;通用产品订单</div>
        <div class="cTitle2">通用产品订单</div>
        <div class="main-search">
            <div class="top clearfix">
                <form class="form-inline" method="get" value="{:U('OrderProduct/orderProduct', array('id' => 115))}">
                    <div class="form-group">
                        <input type="text" name="name" class="form-control" placeholder="产品名称/代理商" value="{$name}"/>
                    </div>
                    <button type="submit" class="btn btn-warning">查询</button>
                    <input type="hidden" id="chkState" value="{:U('OrderProduct/orderProduct')}"/>
                </form>
            </div>
        </div>
        <table class="cTable table-hover" width="100%">
            <tr>
                <th width="5%">编号</th>
                <th width="20%">产品名称</th>
                <th width="5%">数量</th>
                <th width="10%">实际收入</th>
                <th width="10%">代理商</th>
                <th width="10%">应付全款</th>
                <th width="10%">应付预付</th>
                <th width="8%">下单时间</th>
                <th width="10%">备注</th>
                <th width="15%">状态</th>
                <th width="4%">操作</th>
            </tr>
            <volist name="info" id="vo">
                <tr>
                    <td>{$i}</td>
                    <td class="text-c1">{$vo.tour_name}</td>

                    <td>{$vo.quantity}</td>
                    <if condition="$vo['state'] eq 2">
                        <td id="money-right">0.00</td>
                        <elseif condition="$vo['state'] eq 3"/>
                        <td id="money-right">0.00</td>
                        <elseif condition="$vo['state'] eq 5"/>
                        <td id="money-right">0.00</td>
                        <elseif condition="$vo['state'] eq 6"/>
                        <td id="money-right">{$vo.prepay_amount|getYuan}</td>
                        <elseif condition="$vo['state'] eq 7"/>
                        <td id="money-right">{$vo.price_payable|getYuan}</td>
                    </if>
                    <td>{$vo.agency_name}</td>
                    <td id="money-right" class="text-c5">{$vo.price_payable|GetYuan}</td>
                    <td id="money-right" class="text-c1">{$vo.prepay_amount|GetYuan}</td>
                    <td>{$vo.create_time}</td>
                    <td><a href="javascript:void(0)" data-toggle="tooltip" data-placement="top" title="{$vo.memo}"
                           class="text-c1">
                        <if condition="$vo['memo'] == ''">
                            无
                            <else/>
                            {$vo.memo|substr=0,12}
                        </if>
                    </a></td>
                    <td>
                        <if condition="$vo.state eq 1"><span style="color:red">未提交</span>
                            <elseif condition="$vo.state eq 2"/>
                            <span style="color:blue">已提交</span>
                            <elseif condition="$vo.state eq 3"/>
                            <span style="color:darkgreen">已确认待付款</span>
                            <elseif condition="$vo.state eq 4"/>
                            <span style="color:red">已取消</span>
                            <elseif condition="$vo.state eq 5"/>
                            <span style="color:red">已关闭</span>
                            <elseif condition="$vo.state eq 6"/>
                            <span style="color:darkgreen">已付预付款</span>
                            <elseif condition="$vo.state eq 7"/>
                            <span style="color:blue">已付全款</span>
                        </if>
                    </td>
                    <td>
                        <div class="btn-group pull-right">
                            <button type="button" style="padding:3px 7px" class="btn btn-default dropdown-toggle"
                                    data-toggle="dropdown" aria-expanded="false">
                                操作 <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" role="menu" style="margin: 0px;background: #eee">
                                <if condition="($vo['state'] eq 2) or $vo['state'] eq 3">
                                    <li><a onclick="orderChange({$vo.id}, {:Common\\Top::OrderStateWaitForPayment})"
                                           style="cursor: pointer;padding:0px 3px;">确认订单</a></li>
                                    <li><a onclick="changeState({$vo.id}, {:Common\\Top::OrderStateClosed})"
                                           style="cursor: pointer;padding:0px 3px;">关闭订单</a></li>
                                </if>

                                <if condition="$vo['state'] eq 6">
                                    <li><a onclick="orderChange({$vo.id}, {:Common\\Top::OrderStatePrepayed})"
                                           style="cursor: pointer;padding:0px 3px;">确认订单</a></li>
                                </if>


                            </ul>
                        </div>
                    </td>
                    <td id="showMSG{$vo.id}" style="display:none">
                        <div class="theme-popover">
                            <div class="theme-poptit">
                                <a title="关闭" class="closes">&times;</a>

                                <div class="modal-header">
                                    <h4 class="modal-title" style="text-align: left" id="myModalLabel"></h4>
                                </div>
                                <div class="modal-body">
                                    <div class="form-horizontal">
                                        <div class="form-group" id="name">
                                            <label class="col-sm-2 control-label">订单金额：</label>

                                            <div class="col-sm-4" style="text-align: left">
                                                <a style="color:red"></a><a id="total{$vo.id}" style="color:red">{$vo.price_total|GetYuan}</a>
                                            </div>
                                        </div>
                                        <div class="form-group" id="editp{$vo.id}">
                                            <label class="col-sm-2 control-label">价格调整：</label>

                                            <div class="col-sm-4">
                                                <if condition="$vo['price_adjust'] eq 0">
                                                    <input type="text" onblur="editprice({$vo.id})" class="form-control"
                                                           id="adjust{$vo.id}" name="adjust" placeholder="0"
                                                           value="0"/>
                                                    <else/>
                                                <input type="text" onblur="editprice({$vo.id})" class="form-control"
                                                       id="adjust{$vo.id}" name="adjust" placeholder="0"
                                                       value="{$vo.price_adjust|getYuan}"/>
                                                </if>
                                            </div>
                                            <span style="text-align: left" class="col-sm-6 tp" id='edirPrice'>（例如：减：-10，加：10）</span>
                                        </div>
                                        <div class="form-group" id="edit{$vo.id}">
                                            <label class="col-sm-2 control-label">调后价格：</label>

                                            <div class="col-sm-4" style="text-align: left">
                                                <a id="edit_price{$vo.id}"
                                                   style="color:red">{$vo.price_payable|GetYuan}</a>
                                            </div>
                                            <span style="text-align: left" class="col-sm-6 tp"></span>
                                        </div>

                                        <div class="form-group" id="prepay{$vo.id}">
                                            <label class="col-sm-2 control-label">预付金额：</label>

                                            <div class="col-sm-4">
                                                <if condition="$vo['state'] neq 6">
                                                    <input type="text" id="amount{$vo.id}" name="amount"
                                                           class="form-control" placeholder="0"
                                                           value="0"/>
                                                    <else/>
                                                    <input type="text" id="amount{$vo.id}" name="amount"
                                                           class="form-control" placeholder="0"
                                                           value="{$vo.prepay_amount|getYuan}" disabled/>
                                                </if>
                                            </div>
                                            <span style="text-align: left" class="col-sm-6 tp"></span>
                                        </div>

                                        <div class="form-group" id="memo{$vo.id}">
                                            <label class="col-sm-2 control-label">备注：</label>

                                            <div class="col-sm-4" style="text-align: left;">
                                                <textarea name="memos"
                                                          style="width:300px;height:50px;resize:none;padding:6px 12px">{$vo.memo}</textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer pull-right">
                                    <button type="button" class="btn btn-warning" id="button{$vo.id}">确定</button>
                                    <button type="button" class="btn btn-default " id="reset">取消</button>
                                </div>
                            </div>
                        </div>
                        <div class="theme-popover-mask"></div>
                    </td>
                </tr>
            </volist>
        </table>
        <notempty name="info">
            <div class="pagebox">
                {$page}
            </div>
        </notempty>
    </div>
</div>
{:W('Template/bottom')}
<script>
    $(function () {
        $("[data-toggle='tooltip']").tooltip();
    });
</script>
</body>
</html>